package com.vecspace.dayu.code.source.model;

public class SourceCode {
	private String basePath;
	private String filePath;
	private String srcCode;


	/***基准路径（根路径）*/
	public String getBasePath() {
		return basePath;
	}
	/***基准路径（根路径）*/
	public void setBasePath(String basePath) {
		this.basePath = basePath;
	}
	
	/***相对路径及文件名*/
	public String getFilePath() {
		return filePath;
	}
	/***相对路径及文件名*/
	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	public String getSrcCode() {
		return srcCode;
	}
	public void setSrcCode(String srcCode) {
		this.srcCode = srcCode;
	}
	
	public String getFileName() {
		if(filePath == null)return "";
		int idx1 = filePath.lastIndexOf("/");
		int idx2 = filePath.lastIndexOf("\\");
		int idx = idx1;
		if(idx2 > idx) {
			idx = idx2;
		}
		if(idx >= 0) {
			String fileName = filePath.substring(idx + 1);
			return fileName;
		}else return "";
	}
}
